package com.mti.monitor.service;

import com.mti.monitor.mapper.SysMonitorUserMapper;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
@Log4j2
public class SysMonitorUserService {


    @Autowired
    private SysMonitorUserMapper sysMonitorUserMapper;

    /**
     * 数据监控服务
     */
    public int userExist(String userName, String password) {
        int count = sysMonitorUserMapper.selectOne(userName, password);
        if (count == 0) {
            throw new IllegalArgumentException("用户不存在");
        }
        return count;
    }
}
